package com.lkm.market2_0.m_imple.steelyardserver.server.sendtask;

import com.lkm.frame.P;
import com.lkm.frame.task2.ITaskExecutor;
import com.lkm.frame.task2.TaskManager;
import com.lkm.hardware_connect.IHardwareControler;
import com.lkm.market2_0.help.UIP;
import com.lkm.market2_0.m_imple.steelyardserver.server.AbsSendWriteTask;
import com.lkm.market2_0.m_imple.steelyardserver.server.ReceiveTask;



public class SetSteelyardOkTask extends AbsSendWriteTask {

    

    public SetSteelyardOkTask(ITaskExecutor<Object[], Void, Boolean> taskExecutor, TaskManager mTaskManager, IHardwareControler bluetoothSocket, ReceiveTask mReceiveTask) {
        super(taskExecutor, SetSteelyardOkTask.class.getName(), mTaskManager, bluetoothSocket,mReceiveTask);
    }

    @Override
    protected byte onGetRequestCMD(int[] outDataSize) {
        outDataSize[0]=0;
        return 0x0a;
    }

    @Override
    protected byte[] onGetRequestCMDContent() {
        return null;
    }


    @Override
    protected byte[] onGetSendDataItem(int index) {
        return null;
    }


    @Override
    public void onPreExecute() {
        super.onPreExecute();

        if(P.isDebug()) {
            P.p("=======开始设置台秤为ok");
            if(UIP.isPrint()){
                UIP.p("Send设置台秤为Ok：开始",mReceiveTask==null?"":mReceiveTask.steelyardMac);
            }
        }
    }
    @Override
    public void onCancel() {
        super.onCancel();

        if(P.isDebug()) {
            P.p("=======设置台秤为ok取消了");
            if(UIP.isPrint()){
                UIP.p("Send设置台秤为Ok：取消",mReceiveTask==null?"":mReceiveTask.steelyardMac);
            }
        }
    }
    @Override
    public void onFinish(Boolean aBoolean) {
        super.onFinish(aBoolean);

        if(P.isDebug()) {
            P.p("======设置台秤为ok是否成功："+aBoolean);
            if(UIP.isPrint()){
                UIP.p("Send设置台秤为Ok：成功？"+aBoolean,mReceiveTask==null?"":mReceiveTask.steelyardMac);
            }
        }
    }
}